/// This macro will set `Value::Builtin` into `Env`.
/// Type of result value is `EvalResult`.
///
/// Base use like:
/// ```rust
/// // need enable feature builtin
/// use dj::{builtin::*, dependency::*, Env};
///
/// let env = Env::root();
///
/// #[builtin_method]
/// fn add(a: i32, b: Value) -> EvalResult {
///     let b: i32 = b.try_into()?;
///     Ok((a + b).into())
/// }
///
/// builtin!(env, "add", add);
/// ```
///
/// Or:
/// ```rust
/// // need enable feature builtin
/// use dj::{builtin::*, dependency::*, Env};
///
/// let env = Env::root();
///
/// #[builtin_method("add")]
/// fn add(a: i32, b: Value) -> EvalResult {
///     let b: i32 = b.try_into()?;
///     Ok((a + b).into())
/// }
///
/// builtin!(env, add);
/// ```
#[macro_export]
macro_rules! builtin {
    ($env: expr, $name: literal, $func: ty) => {{
        $env.set_macro($name, <$func>::gen)
    }};
    ($env: expr, $func: ty) => {{
        let fun_struct = <$func>::default();
        $env.set_macro(fun_struct.name, <$func>::gen)
    }};
}
